const cloud = require('wx-server-sdk')

cloud.init({
    env: 'j-1g278wytc94978ae'
})

export default async function queryWatchData(params,db,collectionName) {
    try {
        // const {OPENID} = params;
        return await db.collection(collectionName).where({
           open_id: params. OPENID
        })
    } catch (error) {
        return {
            ret: -1,
            data: null,
            errorMsg:JSON.stringify(error)
        }
    }
}
